package gam.t1.appraisal2;

import com.google.common.collect.Lists;
import org.bukkit.plugin.Plugin;

import java.util.List;
import java.util.Objects;

public class DIConfig {
    private static final List<DIConfig> DIConfigs = Lists.newArrayList();
    protected final Plugin plugin;
    protected final String filePath;
    public static void loadAll(){
        try {
            for (DIConfig diConfig : DIConfigs) diConfig.load();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    public static void register(DIConfig diConfig){
        Objects.requireNonNull(diConfig, "DIConfig cannot be null");
        DIConfigs.add(diConfig);
    }

    public DIConfig(Plugin plugin,String filePath) {
        this.plugin = plugin;
        this.filePath = filePath;
    }

    protected void load() {
    }
    protected void reload(){
        load();
    }
}
